Skip to content

Complete mouse support for title, Journal, save prompts, and item pickers - #194

Merged
Adubbz merged 4 commits into
TheMoonPeople:masterfrom
anxiousintrovert:codex/menu-mouse-support
Oct 19, 2026
Merged

Adubbz merged 4 commits into
TheMoonPeople:masterfrom
anxiousintrovert:codex/menu-mouse-support

Conversation

@anxiousintrovert

@anxiousintrovert anxiousintrovert commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

The title screen and new Manual/Journal pages did not consume the existing menu pointer, and ring hitboxes duplicated positions that no longer matched the renderer. Save confirmations also used a vertical Yes/No hitbox despite displaying inline choices, while completion messages could not be acknowledged by mouse.

This extends the existing MenuPointer system:

  • Click Press Start, then hover/click New Game, Continue, or Options; right-click returns to the title prompt. Child screens retain pointer ownership through transitions.
  • Navigate Journal categories, entries, reading pages, and chest-tracker towns/filter. Handle the Manual OPEN state after its slide completes.
  • Use the renderer's animated ring icon positions for hit testing.
  • Hit-test save/load confirmation choices from their laid-out button glyphs, allow right-click Back throughout the save screen, and acknowledge informational completion/error messages with a click anywhere.

Validation: Windows RelWithDebInfo build and CTest (388 passed, 4 environment-dependent skips), including four new save-pointer regressions. Scripted Windows mouse checks reached Options, Load, and the new-game introduction. The same handlers were exercised through a separate local Android touch bridge: x86_64 emulator title navigation and ARM64 Galaxy Z Fold (SM-F966W) title, Options/Back, and actual save loading through Yes. Completion dismissal was also checked on the Fold; the final anywhere-click behavior has a regression test. Android bridge/platform changes are not included in this PR. No PS2 source or submodule changes.

Door/object item picker

  • Select and use occupied item cells with the menu pointer, scroll with the mouse wheel, and cancel with right-click.
  • Follow the rendered row animation and clipping when hit-testing; clicks outside occupied cells do not select an item.
  • Preserve the game's existing item validation and consumption logic through a port-side wrapper. This also supports Android taps through the separate Android menu-touch bridge; that bridge is not included here.

Validation for this addition: Windows executable and Android profile builds succeeded in the local integration checkout. The new implementation was formatted with clang-format and checked with clang-tidy; git diff --check passed. Door/object picker gameplay testing is still pending. No ps2/ or renderer changes.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-18T13:55:13.656251Z 61a2367 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: dc2b46baad

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread port/src/menu_mouse.cpp Outdated
const auto &line = mes.win_line[i];
if (line.code != -0x2F8 && line.code != -0x2FA) continue;
float left = mes.text_x + line.x;
float top = mes.text_y + line.y;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Apply the rendered row offset to save-button hitboxes

When a save/load prompt occupies fewer rows than CommonMenuMes2.rows (as the normal inline prompts do), CommonMenuMes2.centre_rows is true and ClsMes::DrawMesWin renders each glyph with char_height * (rows - text_rows) / 2 added to its y-coordinate. This calculation omits that offset, so for a two-row prompt in the four-row window the click band is 20 px above the visible Cross/Circle choices and clicking the displayed Yes/No usually does nothing; derive top from the same centered row origin used by the renderer.

Useful? React with 👍 / 👎.

Comment thread port/src/menu_mouse.cpp
Comment on lines +321 to +323
if ((take.clicked & 2) != 0) {
MenuPointerPress(kInputCircle);
return;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Dismiss the ending completion on right click

When the ending-only save reaches SAVE_KEY_END_SAVE_ENDING, this branch turns every right click into PAD_CIRCLE and returns, but SaveMenuKeyEndSaveEnding in port/src/memcard.cpp only checks PAD_CROSS. Consequently the completion message cannot be dismissed through the right-click/Back path (unlike SAVE_KEY_END_SAVE); send the acknowledgement input for this state or make its state handler accept Circle.

Useful? React with 👍 / 👎.

@anxiousintrovert anxiousintrovert changed the title Complete mouse support for title, Journal, and save prompts Complete mouse support for title, Journal, save prompts, and item pickers Oct 17, 2026
@anxiousintrovert

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 61a23672b5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread port/src/menu_mouse.cpp
MenuPointerPress(kInputCross);
}
} else if (ManualMenu.mode == MANUAL_MODE_READING && x >= 0 && x < 640 && y >= 0 && y < 480) {
MenuPointerPress(x < 160 ? kInputLeft : kInputCross);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Render the pointer on Journal reading pages

When the battle-menu Journal reaches MANUAL_MODE_READING, this splits the captured relative pointer into a 160-pixel previous region and an everywhere-else next region, but MenuManualDraw only renders the page, message, and fixed previous/next arrows; no renderer in this mode consumes MenuPointerHand. The mouse hand therefore stops following the pointer while these spatial hitboxes are active, so users cannot tell which action a click will take, especially whether they have reached the narrow previous region; render the menu pointer on reading pages.

Useful? React with 👍 / 👎.

@Adubbz
Adubbz merged commit 18ea885 into TheMoonPeople:master Oct 19, 2026
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants